<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models\Base;

use Carbon\Carbon;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class WorkUser
 *
 * @property int $id
 * @property string $real_name 真实姓名
 * @property string|null $username 用户名
 * @property string $password 密码
 * @property string|null $tel 手机号
 * @property bool $enable 是否启用
 * @property string|null $memo 备注
 * @property string|null $token token
 * @property \Illuminate\Support\Carbon|null $expired_at 过期时间
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser query()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereEnable($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereExpiredAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereMemo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser wherePassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereRealName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereTel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereToken($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser whereUsername($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser withTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkUser withoutTrashed()
 * @mixin \Eloquent
 */
class WorkUser extends Model
{
	use SoftDeletes;
	use HasDateTimeFormatter;
	const ID = 'id';
	const REAL_NAME = 'real_name';
	const USERNAME = 'username';
	const PASSWORD = 'password';
	const TEL = 'tel';
	const ENABLE = 'enable';
	const MEMO = 'memo';
	const TOKEN = 'token';
	const EXPIRED_AT = 'expired_at';
	const CREATED_AT = 'created_at';
	const UPDATED_AT = 'updated_at';
	const DELETED_AT = 'deleted_at';
	protected $table = 'work_users';

	protected $casts = [
		self::ID => 'int',
		self::ENABLE => 'bool',
		self::EXPIRED_AT => 'datetime',
		self::CREATED_AT => 'datetime',
		self::UPDATED_AT => 'datetime'
	];
}
